
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/site.master" AutoEventWireup="true"  CodeFile="Artikl.aspx.cs" Inherits="Artikl" Title="Artikl List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Artikl List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" Visible="true" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
			AutoGenerateColumns="False"					
			OnSelectedIndexChanged="GridView_SelectedIndexChanged"
			DataSourceID="ArtiklDataSource"
			DataKeyNames="Id"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_Artikl.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<asp:BoundField DataField="Naziv" HeaderText="Naziv" SortExpression="Naziv"  />
				<asp:BoundField DataField="BarCode" HeaderText="Bar Code" SortExpression="BarCode"  />
				<asp:BoundField DataField="Kataloskibroj" HeaderText="Kataloskibroj" SortExpression="Kataloskibroj"  />
				<asp:TemplateField HeaderText="Id Proizvodac">
				<ItemTemplate>
						<asp:Repeater ID="Id1" runat="server" DataSourceID="KlijentFilter1">
							<ItemTemplate>
								<%# Eval("ImeKlijenta") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="KlijentFilter1" runat="server"
							DataSourceID="KlijentDataSource1"
							Filter='<%# String.Format("Id = {0}", Eval("IdProizvodac")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:TemplateField HeaderText="Id Jedinicna Mjera">
				<ItemTemplate>
						<asp:Repeater ID="Id2" runat="server" DataSourceID="ArtiklMjeraFilter2">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="ArtiklMjeraFilter2" runat="server"
							DataSourceID="ArtiklMjeraDataSource2"
							Filter='<%# String.Format("Id = {0}", Eval("IdJedinicnaMjera")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:TemplateField HeaderText="Id Artikl Kategorija">
				<ItemTemplate>
						<asp:Repeater ID="Id3" runat="server" DataSourceID="ArtiklKategorijaFilter3">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="ArtiklKategorijaFilter3" runat="server"
							DataSourceID="ArtiklKategorijaDataSource3"
							Filter='<%# String.Format("Id = {0}", Eval("IdArtiklKategorija")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:TemplateField HeaderText="Id Porez">
				<ItemTemplate>
						<asp:Repeater ID="Id4" runat="server" DataSourceID="PorezFilter4">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="PorezFilter4" runat="server"
							DataSourceID="PorezDataSource4"
							Filter='<%# String.Format("Id = {0}", Eval("IdPorez")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


			</Columns>
			<EmptyDataTemplate>
				<b>No Artikl Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnArtikl" OnClientClick="javascript:location.href='/NetROS.Tiers.website/admin/ArtiklEdit.aspx'; return false;" Text="Add New"></asp:Button>
			
		<data:KlijentDataSource ID="KlijentDataSource1" runat="server"
			SelectMethod="GetAll"
		/>

		<data:ArtiklMjeraDataSource ID="ArtiklMjeraDataSource2" runat="server"
			SelectMethod="GetAll"
		/>

		<data:ArtiklKategorijaDataSource ID="ArtiklKategorijaDataSource3" runat="server"
			SelectMethod="GetAll"
		/>

		<data:PorezDataSource ID="PorezDataSource4" runat="server"
			SelectMethod="GetAll"
		/>

		<data:ArtiklDataSource ID="ArtiklDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
		>
			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:ArtiklDataSource>
	    		
</asp:Content>



